package com.efesco.payroll.classItem;

import com.bstek.dorado.view.AbstractViewModel;
import com.bstek.dorado.common.DoradoContext;
import com.bstek.dorado.data.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;
import com.bstek.dorado.data.db.DBStatement;


/**
 * computerOrderViewModel
 */
public class computerOrderViewModel extends AbstractViewModel {
	public void setComputerOrder(ParameterSet parameters) throws Exception{ 
		Dataset dataset = getDataset("datasetComputerOrder");
		
		RecordIterator ri = dataset.recordIterator();
		//dataset.re
		//ri.setVisibility(Dataset.FILTER_ALL);
		//int i=1;
		String sql="";
			
		
		while (ri.hasNext()) {	
		  DBStatement statement =new DBStatement();		
		  Record record = ri.nextRecord();			
		  sql="update s_wa_classitem set compute_order="+record.getString("compute_order")+" "
          +"where wa_classitem_id="+record.getString("wa_classitem_id")+"";
		  statement.setSql(sql);  			  
		  statement.execute();
		  statement.close();
		  //record.setValue("compute_order",new Integer(i));
		  //i++;
		}
		
		//super.doUpdate(parameters);   
	}
}
